<?php use_helper('Post', 'Date', 'I18N', 'Object', 'Validation') ?>

<?php if ($post): ?>
  <?php include_partial('post', array('post' => $post)) ?>
  
  <div id="comments">
  
  <?php if ($post->getIsCommented()): ?>
  
    <?php if (count($post->getComments()) > 0): ?>
    <div class="comments" id="comments_<?php echo $post->getId() ?>">
      <h3><?php echo __('Comments :') ?></h3>
    
      <?php foreach ($post->getNoSpamComments() as $comment): ?>
        <?php include_partial('comment/comment', array('comment' => $comment)) ?>
      <?php endforeach; ?>
      
    </div>
    <?php endif; ?> 
    
    <?php echo form_tag($post->getPermalink().'#form-comment', 'id="form-comment" class="comment-response"') ?>
    
      <h3><?php echo __('Leave a reply :') ?></h3>
      
      <?php if ($sf_flash->has('notice')): ?>
        <p class="notices"><?php echo $sf_flash->get('notice') ?></p>
      <?php endif; ?>
      
      <?php echo form_error('name') ?>
      <p>
        <?php echo object_input_hidden_tag($new_comment, 'getId') ?>
        <label for="name"><?php echo __('Name :') ?><span class="required">*</span></label>
        <?php echo object_input_tag($new_comment, 'getName', 'class="text" maxlength="255"') ?>
      </p>
      
      <?php echo form_error('mail') ?>
      <p>
        <label for="mail"><?php echo __('Email :') ?><span class="required">*</span></label>
        <?php echo object_input_tag($new_comment, 'getMail', 'class="text" maxlength="255"') ?>
      </p>
      
      <p>
        <label for="web"><?php echo __('Website Url :') ?></label>
        <?php echo object_input_tag($new_comment, 'getWeb', 'class="text" maxlength="255"') ?>
      </p>
      
      <?php echo form_error('body') ?>
      <p>
        <label for="body"><?php echo __('Your comment :')?><span class="required">*</span></label>
        <?php echo object_textarea_tag($new_comment, 'getBody') ?>
      </p>
      
      <p>
        <button type="submit" class="positive">
        <?php echo __('Post your comment') ?>
        </button>
      </p>
    
    </form>
    
  <?php else: ?>
  
  <p><?php echo __('Replies are closed.') ?></p>
  
  <?php endif; ?>
  
  </div>
  
<?php endif; ?>

<?php slot('archive') ?>
  <?php include_partial('post/archive', array('archives' => $archives)) ?>
<?php end_slot() ?>
